import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/user/login',
    method: 'post',
    data
  })
}
export function getData() {
  return request({
    url: '/user/data',
    method: 'get'
  })
}
export function getInfo() {
  return request({
    url: '/user/info',
    method: 'get'
  })
}

export function logout() {
  return request({
    url: '/user/logout',
    method: 'post'
  })
}

export function getUsertList(data) {
  return request({
    url: '/user/list',
    method: 'post',
    data
  })
}

export function deleteUser(id) {
  return request({
    url: '/user/delete',
    method: 'delete',
    params: { id }
  })
}

export function getInfoSelf() {
  return request({
    url: '/user/center',
    method: 'get'
  })
}

export function saveUser(data) {
  return request({
    url: '/user/save',
    method: 'post',
    data
  })
}

export function getOnlineMessages(data) {
  return request({
    url: '/user/messages',
    method: 'post',
    data
  })
}

export function deleteMessages(id) {
  return request({
    url: '/user/message/delete',
    method: 'delete',
    params: { id }
  })
}

export function passwordUpdate(data) {
  return request({
    url: '/user/password',
    method: 'post',
    data
  })
}
